<include file="Public:header" />
<div class="container main"> <include file="Public:left" />
  <div class="w790">
  <script>
  	function uploaded(path){
		$("#img_url").attr("src",'__PUBLIC__'+path);
		$("input[name='img_url']").val(path);
	}
	
	function del_img(){
		if(confirm('您确定要删除图片吗?')){
			var file=$("input[name='img_url']").val();
			$.post("{:U('delImgBypath')}",{'path':file},function(data){
				$("input[name='img_url']").val('');
				$("#img_url").attr('src','');
			});
		}else{
			return false;
		}
	}
	//删除图组图片
	function mdel_img(path){
		$('#img_list div img').each(function(index, element) {
			$.post("{:U('delImgBypath')}",{'path':path},function(data){
				if(data=='OK'){
					
					$('#img_list div').each(function(index, element) {
                        if($(this).attr('url')==path){
							$(this).remove();
						}
                    });
					
					$('#picmsg input').each(function(index, element) {
                        if($(this).val()==path){
							$(this).remove();
						}
                    });
				}
			});
		});
	}
	
  </script>
  <h1><a href="{:U('index')}">返回列表</a></h1>
    <form class="checkoutform" action="{:U('insert')}" method="post">
      <table class="table table-bordered" width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td align="right">效果图</td>
        <td>
		<assign name="svo['name']" value="img_url" />
		<script>
			function uploaded{$svo.name}(path,name){
				$("#"+name).attr("src",'__PUBLIC__'+path);
				$("input[name='"+name+"']").val(path);
			}
			function del_img{$svo.name}(name){
				if(confirm('您确定要删除图片吗?')){
					var file=$("input[name='"+name+"']").val();
					$.post("{:U('delImgBypath')}",{'path':file},function(data){
						$("input[name='"+name+"']").val('');
						$("#"+name).attr('src','');
					});
				}else{
					return false;
				}
			}
		</script>
        <input type="hidden" name="{$svo.name}" value="{$cur_setting[$svo['name']]}" />
        <iframe frameborder="0" width="400" height="40" scrolling="no" src="{:U('upload',array('name'=>$svo['name']))}"></iframe>
        <img src="{:getThumbPath($cur_setting[$svo['name']])}" id="{$svo.name}" height="80" /><a href="javascript:void(0);" onclick="del_img{$svo.name}('{$svo.name}');">删除</a></td>
      </tr>
      <tr>
        <td align="right"> 模板名称</td>
        <td><input type="text" name="title" value="{$info.title}" /></td>
      </tr>
      <tr>
        <td align="right">模板目录名称</td>
        <td><input type="text" name="name" value="{$info.name}" /></td>
      </tr>
      <tr>
        <td align="right">固定的栏目列表</td>
        <td><textarea name="categoryList" cols="100%" rows="6" id="categoryList">{$info.categoryList}</textarea>
          (json数据形式；如{&quot;value&quot;:&quot;title&quot;})</td>
      </tr>
      <tr>
        <td align="right">使用的模板文件列表</td>
        <td><textarea name="templateFileList" cols="100%" rows="6" id="templateFileList">{$info.templateFileList}</textarea></td>
      </tr>
      <tr>
        <td align="right">使用的模块文件列表</td>
        <td>
        
        
        
        
        
        
        
        
        
        <textarea name="modulesList" cols="100%" rows="6" id="modulesList">{$info.modulesList}</textarea></td>
      </tr>
      <tr>
        <td align="right">内容管理扩展</td>
        <td><textarea name="extendsField" cols="100%" rows="6" id="extendsField">{$info.extendsField}</textarea>
        (使用模板配置生成工具生成字符串)</td>
      </tr>
      <tr>
        <td align="right">商品管理扩展</td>
        <td><textarea name="productExtendsField" cols="100%" rows="6" id="productExtendsField">{$info.productExtendsField}</textarea></td>
      </tr>
      <tr>
        <td align="right">模板配置项列表</td>
        <td><textarea name="config" cols="100%" rows="6">{$info.config}</textarea></td>
      </tr>
      <tr>
        <td align="right">所属组</td>
        <td><select name="group_id">
        <volist name="group_list" id="vo">
        <option <eq name="vo['id']" value="$info['group_id']">selected="selected"</eq> value="{$vo.id}">{$vo.title}</option>
        </volist>
        </select></td>
      </tr>
      <tr>
        <td align="right">所需积分</td>
        <td><input name="score" type="text" id="score" value="{$info.score}" /></td>
      </tr>
      <tr>
        <td align="right">价格</td>
        <td><input name="price" type="text" id="price" value="{$info.price}" /></td>
      </tr>
      <tr>
        <td align="right">是否启用</td>
        <td><label>
          <input name="status" type="radio" id="is_nav_" value="1" checked="checked" <eq name="info['status']" value="0">checked="checked"</eq> />
          是</label>
          <label>
            <input name="status" type="radio" id="is_nav_8" value="0" <eq name="info['status']" value="0">checked="checked"</eq> 
            />
            否</label></td>
      </tr>
        <tr><td colspan="2" align="center"><button>提交</button></td>
        </tr>
      </table>
    </form>
  </div>
  <div class="clear"></div>
</div>


</body></html>